<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CGI.pb</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font><font color="#3A3966">;   PureBasic - CGI example file
</font><font color="#3A3966">;
</font><font color="#3A3966">;    (c) Fantaisie Software
</font><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font>
<font color="#3A3966">; To test it, you will need to compile it as an standalone executable and put it in the /cgi-bin/ folder of your
</font><font color="#3A3966">; webserver.
</font><font color="#3A3966">;
</font>
<b><font color="#3A3966">If</font></b> <b><font color="#3A3966">Not</font></b> <font color="#3A3966">InitCGI</font>() <b><font color="#3A3966">Or</font></b> <b><font color="#3A3966">Not</font></b> <font color="#3A3966">ReadCGI</font>()
  <b><font color="#3A3966">End</font></b>
<b><font color="#3A3966">EndIf</font></b>

<font color="#3A3966">WriteCGIHeader</font>(<font color="#924B72">#PB_CGI_HeaderContentType</font>, "text/html", <font color="#924B72">#PB_CGI_LastHeader</font>) <font color="#3A3966">; Write the headers to inform the browser of the content format
</font>
<font color="#3A3966">WriteCGIString</font>("&lt;html&gt;&lt;title&gt;PureBasic CGI&lt;/title&gt;&lt;body&gt;")  

<b><font color="#3A3966">Procedure</font></b> <font color="#3A3966">WriteCGIConstant</font>(Constant$)
<font color="#3A3966">  WriteCGIString</font>(Constant$ + ": " +<font color="#3A3966"> CGIVariable</font>(Constant$)+"&lt;br&gt;")
<b><font color="#3A3966">EndProcedure</font></b>

<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_AuthType</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ContentLength</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HeaderContentType</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_DocumentRoot</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_GatewayInterface</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_PathInfo</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_PathTranslated</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_QueryString</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RemoteAddr</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RemoteHost</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RemoteIdent</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RemotePort</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RemoteUser</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RequestURI</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_RequestMethod</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ScriptName</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ScriptFilename</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ServerAdmin</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ServerName</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ServerPort</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ServerProtocol</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ServerSignature</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_ServerSoftware</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpAccept</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpAcceptEncoding</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpAcceptLanguage</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpCookie</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpForwarded</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpHost</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpPragma</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpReferer</font>)
<font color="#3A3966">WriteCGIConstant</font>(<font color="#924B72">#PB_CGI_HttpUserAgent</font>)

<font color="#3A3966">WriteCGIString</font>("&lt;/body&gt;&lt;/html&gt;")
</font></pre>
</body></html>
